Skip to content

Conversation

@wellingtoncosta
Copy link
Collaborator

@wellingtoncosta wellingtoncosta commented Dec 22, 2025

Summary

This PR introduces a new component called PopupAd, which is designed to be used inside a popup container to give a more informative description to that menu. To use that, you can pass a composable to the adContent parameter introduced to the Menu and PopupContainer public API. This API is designed to be simpler as we have in AbstractPopup#setAdText method in the legacy Swing implementation, but in a "composey" way.

Additionally, a new Menus section was introduced to the sample app to showcase menus, including a dedicated sample for menu with ad content.

Screenshots
image
image

Release notes

⚠️ Important Changes

  • Introduced a new PopupAd component
  • Added the new PopupAdStyle to the JewelTheme and to the IntUiTheme
  • Added adContent parameter to PopupContainer and Menu components.

New features

  • Popups now have an ad content slot in which can be used to add a helper text to the menu.

Note

Adds a styled ad area for popups and wires it through themes and APIs.

  • New PopupAd component and styling types: PopupAdStyle, PopupAdColors, PopupAdMetrics; exposes JewelTheme.popupAdStyle
  • Extends DefaultComponentStyling/ComponentStyling and IntUiTheme to include popupAdStyle; adds Int UI defaults (IntUiPopupAdStyling.kt) and LaF bridge reader readPopupAdStyle()
  • Enhances PopupMenu and PopupContainer with optional adContent slot (keeps deprecated overloads); updates menu rendering to clip and append PopupAd
  • Sample app: adds Menus showcase (including ad-content example) and new menu icons

Written by Cursor Bugbot for commit 68e45ea. This will update automatically on new commits. Configure here.

Copy link
Collaborator

@faogustavo faogustavo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that you are missing the LaF styles loading. Also, make sure to get values to match the theme.

For more details in the AdText styles, check the JBUI.CurrentTheme.Advertiser type. You can find its usage to use as baseline on this function public void setAdText(@NotNull @NlsContexts.PopupAdvertisement String s, int alignment)

@wellingtoncosta wellingtoncosta force-pushed the wp/implement-popup-ad-text branch 2 times, most recently from 4356525 to c4d0b61 Compare December 23, 2025 16:57
@wellingtoncosta wellingtoncosta force-pushed the wp/implement-popup-ad-text branch from c4d0b61 to 91fba7f Compare December 23, 2025 17:38
@wellingtoncosta wellingtoncosta force-pushed the wp/implement-popup-ad-text branch 2 times, most recently from ecf2915 to 20db336 Compare December 30, 2025 20:47
Copy link
Collaborator

@faogustavo faogustavo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update API Dumps after updating public apis. Run the 'apiChecks' task in the IDE for it :)

@wellingtoncosta wellingtoncosta force-pushed the wp/implement-popup-ad-text branch from 20db336 to 259bd6b Compare January 6, 2026 23:16
@wellingtoncosta wellingtoncosta force-pushed the wp/implement-popup-ad-text branch 2 times, most recently from 779db91 to 60a6e3f Compare January 7, 2026 14:48
Copy link
Collaborator

@faogustavo faogustavo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@wellingtoncosta wellingtoncosta force-pushed the wp/implement-popup-ad-text branch from 60a6e3f to 932f1b6 Compare January 12, 2026 21:53
@wellingtoncosta wellingtoncosta force-pushed the wp/implement-popup-ad-text branch from 932f1b6 to 2d55cab Compare January 12, 2026 22:54
@wellingtoncosta wellingtoncosta force-pushed the wp/implement-popup-ad-text branch from 2d55cab to 5df0e71 Compare January 13, 2026 17:44
@wellingtoncosta wellingtoncosta force-pushed the wp/implement-popup-ad-text branch from 5df0e71 to 1d5e506 Compare January 13, 2026 21:45
Copy link
Collaborator

@faogustavo faogustavo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor comment. No blockers

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about only using the 'JBUI.CurrentTheme.Advertiser.*' class methods instead of getting by key? This way we don't need to duplicate/copy the fallback logic. And if they change in the future we get that automatically

) {
content()

adContent?.let { PopupAd(modifier = Modifier.fillMaxWidth()) { it() } }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is the only place we can use PopupAd, I'm wondering whether its style should simply be a property of the popup container's style? I.e., PopupContainerStyle should have an adStyle property added. Then we do not need to create a composition local for it, nor add an overload for the default component styling, nor add the JewelTheme extension. WDYT? Should simplify the PR even more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants